﻿using LightSO.Entity.Enums;
using LightSO.ILibrary;
using MongoDB.Bson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace LightSO.Extensions
{
    public static class ObjectIdExtension
    {
        public static ObjectId NewId()
        {
            return ObjectId.GenerateNewId();
        }

        public static ObjectId ParseObjectId(this string id)
        {
            return ObjectId.Parse(id);
        }

        public static bool IsEmpty(this ObjectId id)
        {
            return ObjectId.Empty.Equals(id);
        }

        public static bool Equals(this ObjectId oldid, ObjectId id)
        {
            return oldid.Equals(id);
        }

        public static string ToString(this ObjectId id)
        {
            return id.ToString();
        }
    }
}
